<include file="Public:head" />
<style>
    tr td{
        text-align: center;
    }
    .width20{
        width: 100px !important;
        margin-left: 10px;
    }
    .mingchen{
        width: 300px;
        overflow: hidden;
        display: inline-block;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
</style>
<body class="overflow-hidden">
<div class="wrapper preload">
    <include file="Public:header" />
    <include file="Public:left" />

    <div class="main-container">
        <div class="padding-md">
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title">
                        简单统计
                    </div>
                </div>
            </div>
            <div class="col-sm-12 row chach">
                <form action="__SELF__" id="searchForm" name="searchform"method="get">
				
					<div class="right_select">
                        <select class="form-control width20" name="sarea"  style="width: 60px;padding: 5px;">
						<option value="">请选择校区</option>
							<volist name="sarea" id="vo">
								<option value="{$vo['id']}" >{$vo.name}</option>
							</volist>
						</select>
                    </div>
                    <div class="right_select">
                        <select class="form-control width20" name="type">
                            <option value="user" <if condition="$data.type eq 'user'">selected</if>>查新馆员</option>
                            <option value="fw" <if condition="$data.type eq 'fw'">selected</if>>查新范围</option>
                            <option value="md" <if condition="$data.type eq 'md'">selected</if>>查新目的</option>
                            <!--<option value="school" <if condition="$data.type eq 'school'">selected</if>>委托机构</option>-->
                            <option value="intime" <if condition="$data.type eq 'intime'">selected</if>>委托时间</option>
                            <option value="endtime" <if condition="$data.type eq 'endtime'">selected</if>>完成时间</option>
                            <!-- <option value="dw">委托单位</option>
                             <option value="wttime">委托时间</option>
                             <option value="time">查新完成时间</option>-->
                            <!--<volist name="userList" id="vo">
                              <option value="{$vo.id}" <if condition="$data['id'] eq $vo['id']">selected</if>>{$vo.name}</option>
                            </volist>-->
                        </select>
                        <span style="margin-left: 5px;float: left;margin-top: 5px;">时间：</span>
                        <input type="text" id="B_number1" class="form-control width20" onClick="WdatePicker()" name="starttime" value="{$data.starttime}">
                        <input type="text" id="B_number2" class="form-control width20" onClick="WdatePicker()" name="endtime" value="{$data.endtime}">
                    </div>
                    <!--<p style="clear: both"></p>-->
                    <div style="">
                        <!--<button class="select_btn" type="submit">查&nbsp询</button>
                        <button class="select_btn" type="submit">打&nbsp印</button>
                        <button class="select_btn">下&nbsp载</button>
                        <a href="" class="select_btn" style="width: 150px;">生成详细年度报告</a>-->
                        <input type="submit"  class="action-button"  value="搜索" onclick="checkaction(0);"/>
                        <!--<input type="submit"  class="select_btn"  value="打印" onclick="checkaction(3);"/>-->
                        <input type="submit"  class="action-button"  value="下载" onclick="checkaction(2);"/>
                    </div>
                </form>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="smart-widget widget-green">
                        <div class="smart-widget-header row ">
                            <span class="smart-widget-option">
                                <span class="refresh-icon-animated">
                                    <i class="fa fa-spinner fa-spin" style="color:#fff"></i>
                                </span>
                                <a href="#" class="widget-toggle-hidden-option">
                                </a>
                                <a href="#" class="widget-collapse-option" data-toggle="collapse">
                                </a>
                                <a href="#" class="widget-refresh-option">
                                </a>
                            </span>
                        </div>
                        <div class="smart-widget-inner table-responsive">
                            <div class="smart-widget-hidden-section">
                                <ul class="widget-color-list clearfix">
                                    <li style="background-color:#20232b;" data-color="widget-dark"></li>
                                    <li style="background-color:#4c5f70;" data-color="widget-dark-blue"></li>
                                    <li style="background-color:#23b7e5;" data-color="widget-blue"></li>
                                    <li style="background-color:#1fb5ac;" data-color="widget-green"></li>
                                    <li style="background-color:#edbc6c;" data-color="widget-yellow"></li>
                                    <li style="background-color:#fbc852;" data-color="widget-orange"></li>
                                    <li style="background-color:#e36159;" data-color="widget-red"></li>
                                    <li style="background-color:#7266ba;" data-color="widget-purple"></li>
                                    <li style="background-color:#f5f5f5;" data-color="widget-light-grey"></li>
                                    <li style="background-color:#fff;" data-color="reset"></li>
                                </ul>
                            </div>
                            <table class="table table-striped no-margin">
                                <thead>
                                <tr>
                                    <if condition="$frist">
                                        <th class="text-center" style="width: 80px">序号</th>
                                        <th class="text-center " >馆员名称</th>
                                        <th class="text-center"style="width: 200px">馆员角色</th>
                                        <th class="text-center"style="width: 200px">收费工作量</th>
                                        <th class="text-center"style="width: 200px">查新工作量</th>
                                        <th class="text-center"style="width: 200px">审核工作量</th>
                                    <elseif condition="$title"/>
                                        <th class="text-center" style="width: 80px">序号</th>
                                        <th class="text-center"style="width: 200px">{$title}</th>
                                        <th class="text-center"style="width: 200px">{$num}</th>
                                    </if>
                                </tr>
                                </thead>
                                <tbody>
                                <if condition="$frist">
                                    <notempty name="_list">
                                        <volist name="_list" id="vo" key="k">
                                            <tr>
                                                <td>{$k}</td>
                                                <td>{$vo.username}</td>
                                                <td>{$vo.role_name}</td>
                                                <td><a href="{:U('Account/info',array('id'=>$vo['id'],'type'=>'sf','starttime'=>$data['starttime'],'endtime'=>$data['endtime']))}">{$vo.sf_num}</a></td>
                                                <td><a href="{:U('Account/info',array('id'=>$vo['id'],'type'=>'cx','starttime'=>$data['starttime'],'endtime'=>$data['endtime']))}">{$vo.cx_num}</a></td>
                                                <td><a href="{:U('Account/info',array('id'=>$vo['id'],'type'=>'sh','starttime'=>$data['starttime'],'endtime'=>$data['endtime']))}">{$vo.sh_num}</a></td>
                                            </tr>
                                        </volist>
                                        <else/>
                                        <tr>
                                            <td colspan="11">对不起！暂时还没有数据！</td>
                                        </tr>
                                    </notempty>
                                    <elseif condition="$title"/>
                                    <notempty name="_listmd">
                                        <volist name="_listmd" id="vo" key="k">
                                            <tr>
                                                <td>{$k}</td>
                                                <td>{$vo.title}</td>
                                                <td><a href="{:U('Account/info',array('id'=>$vo['cxfw'],'value'=>$vo[title],'type'=>$title,'starttime'=>$data['starttime'],'endtime'=>$data['endtime']))}">{$vo.num}</a></td>
                                            </tr>
                                        </volist>
                                        <else/>
                                        <tr>
                                            <td colspan="11">对不起！暂时还没有数据！</td>
                                        </tr>
                                    </notempty>
                                    <elseif condition="$school"/>
                                    <volist name="_listmd" id="vo" empty="对不起，暂时还没有数据" key="k">
                                        <tr>
                                            <td>{$k}</td>
                                            <td>{$vo.title}</td>
                                            <td><a href="{:U('Account/info',array('type'=>$type,'value'=>$vo['title'],'starttime'=>$data['starttime'],'endtime'=>$data['endtime']))}">{$vo.num}</a></td>
                                        </tr>
                                    </volist>
                                </if>
                                </tbody>
                            </table>
                            <div class="choose-page row">
                                {$_page}
                            </div>
                        </div><!-- ./smart-widget-inner -->
                    </div><!-- ./smart-widget -->
					<div style="width:100%;height:260px;background:#fff;overflow:hidden;padding:15px 0; border-radius: 4px;-webkit-border-radius: 4px;-ms-border-radius: 4px;-moz-border-radius: 4px;-o-border-radius: 4px;box-shadow: 2px 2px 2px 2px #ccc;">
						<?php
						if($frist == 'yes')
						{
						?>
						<div id="main" class="charts" style="width: 95%;height: 230px;float:left;" ></div>
						<?php
						}else{
						?>
						<div id="main2" class="charts" style="width: 50%;height: 230px;float:left;" ></div>
						<div id="main3" class="charts" style="width: 50%;height: 230px;float:left;" ></div>
						<?php
						}
						?>
					</div>
                </div><!-- ./col -->
            </div><!-- ./row -->
        </div><!-- ./padding-md -->
    </div><!-- /main-container -->
    <include file="Public:foot" />
</div><!-- /wrapper -->
<include file="Public/base_fc" />
<a href="#" class="scroll-to-top hidden-print"><i class="fa fa-chevron-up fa-lg"></i></a>
</body>
</html>
<block name="script">
    <script>
        $(function(){
            highlight_nav2('{:U("Account/simpleCount")}');

        })

        function checkaction(v){
            if(v==0){
                document.searchform.action="{:U('Account/simpleCount')}";
            }else if(v==1){
            }else if(v==2){
                document.searchform.action="{:U('Account/down')}";
            }
            searchform.submit();
        }
    </script>
</block>

<?php
if( $frist == 'yes')
{
	$name_list = '';
	$sfgzl = '';
	$cxgzl = '';
	$shgzl = '';
	foreach( $_list as $_lvo)
	{
		$name_list .= '"'.$_lvo['username'].'",';
		$sfgzl .= '"'.$_lvo['sf_num'].'",';
		$cxgzl .= '"'.$_lvo['cx_num'].'",';
		$shgzl .= '"'.$_lvo['sh_num'].'",';
	}
	
	$name_list = substr( $name_list, 0, -1);
	$sfgzl = substr( $sfgzl, 0, -1);
	$cxgzl = substr( $cxgzl, 0, -1);
	$shgzl = substr( $shgzl, 0, -1);

	
?>

<script>
    require.config({
        paths: {

            'echarts': ""

        }
    });

    var myChart1, option1;// 使用

    require(

        ['echarts', 'echarts/chart/bar'],

        function (ec0) {
            myChart1 = ec0.init(document.getElementById('main'));

              option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {
                        type: 'shadow'
                    }
                },
                legend: {
                    data:['收费工作量','查新工作量','审核工作量'],
					x:'left',
					y:'top'
                },
                toolbox: {
                    show : true,
                    orient : 'vertical',
					x:'left',
                    y : 'center',
                    feature : {
                        mark : {show: true},
						dataView : {show: true, readOnly: false},
                        magicType : {show: false},
                        restore : {show: true},
						saveAsImage : {show: true}
                    }
                },
                color:['#2ec8ca', '#ffb880','#5bb2ef'],
                calculable : true,
                xAxis : [
                    {
                        type : 'category',
                        data : [<?=$name_list?>],
                        axisLine:{
                            lineStyle:{
                                color:'#d8dbe0'
                            }
                        },
						axisLabel:{
							rotate:-40
						}
                    }
                ],
                yAxis : [
                    {
                        type : 'value',
                        splitArea : {show : true},
                        axisLine:{
                            lineStyle:{
                                color:'#d8dbe0'
                            }
                        }
                    }
                ],
                grid: {
                    x2:40
                },
                series : [
                    {
                        name:'收费工作量',
                        type:'bar',
                        data:[<?=$sfgzl?>]
                    },
                    {
                        name:'查新工作量',
                        type:'bar',
                        data:[<?=$cxgzl?>]
                    },
                    {
                        name:'审核工作量',
                        type:'bar',
                        data:[<?=$shgzl?>]
                    },
                ]
            };

            myChart1.setOption(option);


            setTimeout(function (){
                window.onresize = function () {
                    myChart1.resize();
                }
            },200)

            myChart1.setOption(option);
        }
    );

</script>
<?php
}else if( $type == 'fw' || $type == 'md'){

	$name_list = '';
	$jieguo = '';
	$btjieguo = '';
	foreach( $_listmd as $_lmvo)
	{
		$title_list .= '"'.$_lmvo['title'].'",';
		$jieguo .= "{name:'".$_lmvo['title']."',type:'bar',data:[".$_lmvo['num']."], barWidth : 40,},";
		$btjieguo .= "{value:".$_lmvo['num'].", name:'".$_lmvo['title']."'},";

	}
	
	$title_list = substr( $title_list, 0, -1);
?>

<script>

    require.config({
        paths: {

            'echarts': ""

        }
    });


 var myChart1, myChart2,option,option1;// 使用

    require(

        ['echarts', 'echarts/chart/bar','echarts/chart/pie'],

        function (ec0) {
            myChart1 = ec0.init(document.getElementById('main2'));
			myChart2 = ec0.init(document.getElementById('main3'));

            option = {
                tooltip : {
                    trigger: 'axis',
                    axisPointer : {
                        type: 'shadow'
                    }
                },
                legend: {
                    data:[<?=$title_list?>],
					x:'left',
					y:'top'
                },
                  toolbox: {
                    show : true,
                    orient : 'vertical',
                    y : 'center',
                    feature : {
                        mark : {show: true},
                        magicType : {show: false},
                        restore : {show: true},
                        saveAsImage : {show: true}
                    }
                },
                color:[],
                calculable : true,
                xAxis : [
                    {
                        type : 'category',
                        data : [''],
                        axisLine:{
                            lineStyle:{
                                color:'#d8dbe0'
                            }
                        }
                    }
                ],
                yAxis : [
                    {
                        type : 'value',
                        splitArea : {show : true},
                        axisLine:{
                            lineStyle:{
                                color:'#d8dbe0'
                            }
                        }
                
                    }
                ],
                grid: {
                    x2:40
                },
                series : [
                    <?=$jieguo?>
                ]
            };

			option1 = {
					title : {
						text: '',
						subtext: '',
						x:''
					},
					tooltip : {
						trigger: 'item',
						formatter: "{a} <br/>{b} : {c} ({d}%)"
					},
					legend: {
						data:[<?=$title_list?>],
						orient : 'vertical',
						x : 'left',
						y : 'top'
						
					},
					toolbox: {
						show : true,
						feature : {
							mark : {show: true},
							dataView : {show: true, readOnly: false},
							magicType : {
								show: true, 
								type: [],
								option: {
									funnel: {
										x: '25%',
										width: '50%',
										funnelAlign: 'left',
										max: 1548
									}
								}
							},
							restore : {show: true},
							saveAsImage : {show: true}
						}
					},
					color:[],
					calculable : true,
					series : [
						{
							name:'访问来源',
							type:'pie',
							radius : '55%',
							center: ['50%', '60%'],
							data:[
								<?=$btjieguo?>
							]
						}
					]
				};

            myChart1.setOption(option);

			myChart2.setOption(option1);
            setTimeout(function (){
                window.onresize = function () {
                    myChart1.resize();
                }
            },200)

            myChart1.setOption(option);
        }
    );




</script>

<?php
}
?>

